/*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Alternatively, this software may be distributed under the terms of BSD
* license.
*
*
*
* Authors:                  zhoujian
* Email:            343600434@qq.com
* Date:         Mar-19-2024 11:55:21
*
*/


#ifndef __rtc_H__
#define __rtc_H__

#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif





typedef enum {
    RTC_State_0x00 = 0x00,
    RTC_State_0x01,
    RTC_State_0x02,
    RTC_State_0x03,
    RTC_State_0x04,
    RTC_State_start_init,
    RTC_State_wait_init,
    RTC_State_init_success,
    RTC_State_init_error
} RTC_zTypeDef;

extern uint16_t idle_time;
extern RTC_zTypeDef rtc_state;


void rtc_init_task(void);
void rtc_task(void);


typedef enum {
    RTC_CLK_SRC_TYPE_HSE128 = 0x01,
    RTC_CLK_SRC_TYPE_LSE = 0x02,
    RTC_CLK_SRC_TYPE_LSI = 0x03,
} RTC_CLK_SRC_TYPE;


extern uint8_t alarm_on;
#define RTC_LSE_TRY_COUNT 200



#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
class rtc
{

public:
    rtc();
    ~rtc();

};
#endif



#endif
